namespace Making.Avalonia.WebView.Core.Models;

public class WebResourceRequestedEventArgs : EventArgs
{
    public string Uri { get; }
    public string Method { get; }
    public Dictionary<string, string> Headers { get; }
    public Stream? RequestBody { get; }
    public WebResourceResponse? Response { get; set; }

    public WebResourceRequestedEventArgs(string uri, string method, Dictionary<string, string> headers, Stream? requestBody = null)
    {
        Uri = uri;
        Method = method;
        Headers = headers;
        RequestBody = requestBody;
    }
}

public class WebResourceResponse
{
    public int StatusCode { get; set; } = 200;
    public string StatusText { get; set; } = "OK";
    public Dictionary<string, string> Headers { get; set; } = new();
    public Stream? Content { get; set; }
    public string? ContentType { get; set; }
}